package com.googlecode.cpbi.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.jar.Manifest;

import org.osgi.framework.Bundle;
import org.osgi.framework.BundleListener;
import org.osgi.framework.Constants;

public interface Osgi {
	public static final Bundle UNINSTALLED_BUNDLE = null;
	public static final char PACKAGE_DELIMITER = ',';
	public static final char ATTRIBUTE_DELIMITER = ';';
	public static final String FRAMEWORK_EXTENSION_FRAGMENT_HOST =
			Constants.SYSTEM_BUNDLE_SYMBOLICNAME + ATTRIBUTE_DELIMITER + Constants.EXTENSION_DIRECTIVE + ":=" + Constants.EXTENSION_FRAMEWORK;

	String[] getBootDelegationPackagePatterns();

	void register(BundleListener bundleListener);

	Bundle tryToInstallBundleFrom(String bundleLocation);

	Bundle installBundleFrom(String bundleLocation) throws IOException;

	Bundle installBundleFrom(InputStream bundleInputStream, String location);

	Bundle installEmptyBundleAround(Manifest manifest, String location);

	void updateSystemBundle();

	void tryToStart(Bundle bundle);
}